package com.group.finance.controller;


import com.group.commons.util.ResponseInfo;
import com.group.commons.util.ResponseStatus;
import com.group.finance.entity.Balance;
import com.group.finance.entity.Transfer;
import com.group.finance.service.impl.TransferServiceImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  转账记录
 * </p>
 *
 * @author zgc
 * @since 2022-06-07
 */
@RestController
@RequestMapping("/transfer")
public class TransferController {

    @Resource
    private TransferServiceImpl transferService;

    //查询转账记录
    @GetMapping("/all/{current}/{size}")
    public ResponseInfo findAllTransfer(@PathVariable("current") int current, @PathVariable("size") int size) {

        List<Transfer> transferList = transferService.findAllTransfer(current, size);

        ResponseInfo<Object> objectResponseInfo = new ResponseInfo<>();
        objectResponseInfo.setData(transferList);
        objectResponseInfo.setCode(200);
        objectResponseInfo.setMessage("返回转账记录");
        objectResponseInfo.setStatus(ResponseStatus.SUCCESS);
        return objectResponseInfo;
    }

}
